import { handleActions } from 'redux-actions'
import { UPDATE_LANDMARK_TYPE } from '../types/landmark'
import DeviceStorage from '../../utils/DeviceStorage'

const Schema = {
  cityName: '北京',
  currentLocation: {}
}
export default handleActions(
  {
    [UPDATE_LANDMARK_TYPE] (state, action) {
      const landmark = {
        ...state,
        ...action.payload
      }
      DeviceStorage.set('landmark', landmark)
      return {
        ...landmark
      }
    }
  },
  Schema
)
